#include <iostream>

class Base
{
    public:
        Base(int a):a(a){}
    protected:
        int b;
};

class Base1:virtual public Base
{
public:
        Base(int a,int b):Base(a),b(b){}
    protected:
        int b;
};

class Base2:virtual public Base
{
public:
        Base(int a,int c):Base(a),c(c){}
protected:
        int c;
};

//虚继承
//用单继承+组合的方式去替代多继承
class Derived:public Base1,public Base2
{
public:
    Derived(int a,int b,int c)
    {
        this->a=a;
    }
private:
    Base2 b;
}